home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / iterat31.zip / ITERATE!.TXT < prev    next >
Text File  |  1993-12-29  |  74KB  |  1,629 lines

  1.                                                                             
  2.                           ╔════════════════════════╗
  3.                           ║                        ║
  4.                           ║                        ║
  5.                           ║        Iterate!        ║
  6.                           ║                        ║
  7.                           ║      Version  3.11     ║
  8.                           ║                        ║
  9.                           ║                        ║
  10.                           ║                        ║
  11.                           ╟────────────────────────╢
  12.                           ║                        ║
  13.                           ║                        ║
  14.                           ║     Copyright 1993     ║
  15.                           ║                        ║
  16.                           ║                        ║
  17.                           ║           by           ║
  18.                           ║       Brent Hugh       ║
  19.                           ║                        ║
  20.                           ║                        ║
  21.                           ╚════════════════════════╝
  22.                                                   
  23.  
  24.                                        
  25.                               INSTRUCTION MANUAL
  26.                               ══════════════════
  27.                               
  28.  
  29. CONTENTS
  30. ════════════════════════════════════════════════════════════════════════════════
  31.    Quick Start
  32.    Program Distribution
  33.    Files Included
  34.    Legal Disclaimers
  35.    How the Program Works
  36.       Iteration
  37.       Fractals
  38.       Chaos
  39.       Parameters
  40.    Program Commands
  41.       Graphics Screen Commands
  42.       Basic Commands
  43.       Special Commands for Julia/Mandelbrot Sets
  44.       Dos Commands
  45.       Iteration Stack Commands
  46.       User Function Commands
  47.       Edit Menu Commands
  48.    The User Function
  49.       The User Function File
  50.          The Name
  51.          The Defaults
  52.          The Function
  53.       Error Messages
  54.    Video Adapters
  55.    Mouse
  56.    Printing
  57.    Runtime Error Messages
  58.       Heap Overflow Errors
  59.       "Floating Point Overflow" and "Division by Zero" Errors
  60.    Miscellaneous Program Info
  61.    Upcoming Additions
  62.    Bibliography
  63.  
  64.  
  65.  
  66. QUICK START
  67. ════════════════════════════════════════════════════════════════════════════════
  68. At the DOS Prompt, type "Iterate!" to start the program.
  69.  
  70. You are presented with an introductory screen with some instructions.  Press
  71. any key to move on to the graphics screen.  At the graphics screen you can use
  72. the mouse to move around and iterate points.  Press the left mouse button to
  73. iterate a point.  Press the middle mouse button to switch between the graphics
  74. screen and the command screen, which lists all available commands.  (For you
  75. unlucky folks with only two mouse buttons, pressing both buttons together is
  76. the same as pressing the middle button.)
  77.  
  78. If you don't have a mouse, never fear!  Iterate! can accommodate you.  Just use
  79. these keys to move around and iterate points:
  80.  
  81.        Arrows    move
  82.        Space     iterate a point
  83.        M         move the cursor to the next iteration, allowing 
  84.                  you to trace the iterations of a point
  85.        Escape    switch between the graphics screen and the
  86.                  command screen (which lists all available options)
  87.        Q         quit
  88.  
  89. These keys change distance you move when you use the arrow keys:
  90.  
  91.        CapsLock  switch between medium and giant steps
  92.        Shift     make baby steps
  93.  
  94. Note: <CapsLock> is a toggle, but <Shift> must be held down as you're pushing
  95. the arrow for it to have an effect.
  96.  
  97. <Escape> (or middle mouse button, or left and right mouse buttons together)
  98. switches between the graphics screen and the command screen, which lists all
  99. available commands.  However, all commands are available on the graphics screen
  100. (if you can just remember which button to push).
  101.  
  102. <F1> shows a help screen.
  103.  
  104.  
  105. PROGRAM DISTRIBUTION
  106. ════════════════════════════════════════════════════════════════════════════════
  107. This program is SHAREWARE.  Please pass it along to friends, neighbors,
  108. relatives, and fellow mathematics buffs.  If you find it useful, educational,
  109. entertaining or addictive (as I have), please become a registered user by
  110. sending $15 to:
  111.  
  112.                   Brent Hugh
  113.                   986 Raymond Road
  114.                   Fruit Heights, UT 84037
  115.  
  116. The Many Glorious Benefits of Registering
  117. ─────────────────────────────────────────
  118. Becoming a registered user will help me justify work on similar products in the
  119. future--and help you feel less guilty.
  120.  
  121. In addition (as though you really need anything more), registered users will
  122. receive a disk with the latest version of Iterate!, a version of Iterate!
  123. compiled for 286 and better computers (runs 10-20% faster), and several other
  124. programs that illustrate chaos and fractals--including my latest program that
  125. makes 3-D fractals.
  126.  
  127. Also included on the disk will be a Mandelbrot-Julia Set generating program--
  128. the program that generated the file "Mandelbr.gph" that is included with
  129. Iterate!.  Iterate! and this Mandelbrot-Julia generator work hand-in-glove,
  130. together making a powerful tool for investigating the Mandelbrot Set and its
  131. associated Julia Sets.  Using the Mandelbrot-Julia generator, you can create a
  132. graph of the Mandelbrot Set.  You can then load this graph into Iterate! and
  133. enter Julia Set parameters directly from the Mandelbrot Set.  You will
  134. immediately see the correlation between a point on the Mandelbrot Set and its
  135. associated Julia Set.  (See "Function.txt" for more info on this subject.)
  136.  
  137. If you are interested in using multiple copies of Iterate!--in a school
  138. setting, for instance--please write to me about special rates.  I'm sure we
  139. can work something out that will be agreeable to us both.
  140.  
  141. When you register, please include your name and address and specify 3 1/2 or
  142. 5 1/4 inch disks.  Don't forget to include any good user function files you
  143. have come up with--the best ones will be distributed with future versions of
  144. Iterate!.
  145.  
  146. Might I mention that this is a REAL DEAL!  The shareware distributor places
  147. charge around $15 just to send you a program like this and then you're supposed
  148. to register ON TOP of that.
  149.  
  150.  
  151. FILES INCLUDED
  152. ════════════════════════════════════════════════════════════════════════════════
  153. These files are distributed with Iterate! If you share the program with someone
  154. else, please include ALL of these files.  If your copy of Iterate! doesn't
  155. include all of these files, please write me for a complete copy (include a
  156. blank disk and self-addressed, stamped disk mailer if you're not registering).
  157.  
  158.        Iterate!.exe  The program file
  159.        *       .frm  Sample user functions. There will be several of these.
  160.        Mandelbr.gph  A graph of Mandelbrot Set that works with Iterate!
  161.                      (see Function.Txt for more details; see also Note below)
  162.        KBRepeat.exe  Utility to change the keyboard repeat rate
  163.        WhatsNew.txt  What's new in this version of Iterate!
  164.        HowTo   .txt  How to do common things in Iterate!
  165.        Function.txt  A short discussion of the functions in Iterate! with some
  166.                      example parameters and other things you can try
  167.        Jargon  .txt  An explanation of some of the jargon of Iteration Theory
  168.        QuickCmd.txt  Quick one page synopsis of Iterate!'s commands
  169.        Readme  .txt  An overview of Iterate!
  170.        Iterate!.txt  This file
  171.  
  172. Iterate! makes files of these sorts:
  173.  
  174.        *.gph
  175.        *.inf
  176.        *.ini
  177.  
  178. If, after a while, you find a bunch of these files scattered around your disk,
  179. Iterate! is responsible.
  180.  
  181. Note: "Mandelbr.gph" is drawn in VGA mode 1 (which is the same as EGA mode; this
  182. is the default startup graphics mode for Iterate! if you have a VGA or EGA
  183. adapter).  If you are unable to run Iterate! in VGA1 mode or EGA mode, you
  184. won't be able to use "Mandelbr.gph".  Sorry.  If you become a registered user
  185. of Iterate!, you will receive a Mandelbrot-Julia Generator that will allow you
  186. to draw Mandelbrot and Julia Sets in any graphics mode you want.
  187.  
  188.  
  189. LEGAL DISCLAIMERS
  190. ════════════════════════════════════════════════════════════════════════════════
  191. This is the section of the help document where the programmer/programmers
  192. disclaim(s) any responsibility for anything and everything that may or may not
  193. happen as a result of using and/or not using his/her/their program and/or
  194. documentation for any purpose whatsoever.
  195.  
  196. Please consider me so disclaimed.  If you hurt, kill, or maim anything or
  197. anybody by using this program, it's not my fault--especially if you haven't paid
  198. your registration fee.
  199.  
  200. You can't sell this program to anyone (you can charge small distribution/copying
  201. fees).  You can't include this program with other programs that you are selling.
  202. In short, all the profits from this program--meager as they may be--belong to
  203. me, not you.  (Sorry--I'm sure you'll get over it soon.)
  204.  
  205. I retain all rights to this program.  It is not in the public domain.  You
  206. cannot alter it and then distribute the altered version.  (You're welcome to
  207. alter it for your own amusement if you'd like.)
  208.  
  209. (Have you ever noticed that all manuals put the boring legal stuff at the
  210. beginning so you have to plow through it all before you get to the good stuff?
  211. Well, everybody else does it, so I had to, too.  Congratulations on making it
  212. this far--and now here's the good stuff . . .)
  213.  
  214.  
  215.  
  216. HOW THE PROGRAM WORKS
  217. ════════════════════════════════════════════════════════════════════════════════
  218.  
  219. Iteration
  220. ─────────
  221. Iterate! is based on the mathematical idea of iteration. Iteration works like
  222. this: Imagine you have a calculator. Punch a number into the calculator.  Then
  223. pick a function key on the calculator, like 'sin' or 'x²'.  Repeatedly push this
  224. function key, and see what happens.
  225.  
  226. Here are some of the things that can happen when you iterate a function on your
  227. calculator (in parentheses are the function that gives this result and the
  228. number to start with):
  229.  
  230.  *    The number gets closer and closer to some number (cos, any number)
  231.  
  232.  *    The number alternates between two or more numbers (1/x, any number but 1
  233.       or 0)
  234.  
  235.  *    The number gets larger and larger (x², any number larger than 1)
  236.  
  237.  *    The number jumps around in a seemingly random fashion (1-2x², most numbers
  238.       between -1 and 1)
  239.  
  240. Just playing with your calculator like this can provide hours of amusement,
  241. especially if you have a programmable calculator so you can do some of the more
  242. interesting functions.  See the bibliography for some books that provide some
  243. interesting functions and results.
  244.  
  245. This iteration process that you can do with your calculator is exactly what this
  246. program does, except in the program we use "a point on the screen" and "a
  247. function programmed into the computer" instead of "a number" and "a function key
  248. on your calculator."
  249.  
  250. Here are some of the things that can happen when you iterate on the computer:
  251.  
  252.  *    The point spirals in towards a certain point (an attracting fixed
  253.       point)
  254.  
  255.  *    The point does a certain number of points and then repeats.  This is 
  256.       called a periodic point.  The number of points before repetition can be 2,
  257.       20, 200, 2000, 20000, or anything in between.
  258.  
  259.  *    The point traces out a pattern.  The pattern can be anything from
  260.       simple circles or ovals to complex fractals.
  261.  
  262.  *    The point jumps around in a seemingly random fashion (chaos).
  263.  
  264.  *    The point jumps around in a seemingly random fashion, but sticks within
  265.       a certain area.  This area can be simple or complex; often it is a
  266.       fractal.
  267.  
  268. If you experiment with Iterate! a little, you will soon see all of these things
  269. (and many more) happening.
  270.  
  271. Of these things, fractals, chaos, and periodic points are among the more
  272. fascinating.  Here is a little explanation about them.
  273.  
  274. Fractals
  275. ────────
  276. The study of fractals is one of the most fascinating and visually appealing
  277. areas of mathematics.
  278.  
  279. Fractals are shapes that are selfsame under magnification--if you look at a
  280. small part of a fractal, it looks just like the whole thing.  To put it another
  281. way, a fractal has the same shape over many different sizes. (In mathematically
  282. generated fractals, the shape is usually repeated over infinitely many different
  283. sizes.  However, in the fractals found in nature, the shape is typically
  284. repeated between 5 and 20 times.)
  285.  
  286. A good example of a fractal is a tree.  A branch of the tree has the same shape
  287. as the whole tree.  A smaller branch of the tree has the same shape as the
  288. larger branch, as well as the same shape as the whole tree.  So a small part of
  289. the shape looks like the whole thing.
  290.  
  291. Many fractals are found in nature.  Some examples are cauliflower, broccoli,
  292. mountains, river systems, air passages in lungs, the growth pattern of certain
  293. cancer cells, cracks in rocks, clouds, and the pattern of stars in the sky.
  294.  
  295. Nearly all of the functions in Iterate! will produce fractal patterns. Here is
  296. one particularly obvious one: Choose Function C with the default window and
  297. parameters.  Set the number of iterations to 1000.  If you trace out a few
  298. points, you will see a large circle surrounded by five small circles.  If you
  299. try some points near the five small circles, you will find that each of the
  300. five small circles is surrounded by smaller circles.  Zooming in on these
  301. smaller circles would reveal even smaller circles surrounding them.  Further
  302. zooming reveals smaller and smaller circles, always in this same pattern of
  303. a larger circle surrounded by smaller circles.
  304.  
  305. It looks sort of like this (if you can imagine circles instead of squares, and
  306. 3, 4, 5, or 6 circles surrounding, instead of just four each time):
  307.  
  308.  
  309.                                                   
  310.                               O   O      O   O           
  311.                                                  
  312.                                ┌─┐        ┌─┐
  313.                                └─┘        └─┘            
  314.                                                  
  315.                               O   O      O   O           
  316.                                                  
  317.                                    ┌────┐                
  318.                                    │    │       
  319.                                    └────┘               
  320.                                                  
  321.                               O   O      O   O           
  322.                                                  
  323.                                ┌─┐        ┌─┐
  324.                                └─┘        └─┘            
  325.                                                  
  326.                               O   O      O   O           
  327.                                                  
  328.  
  329.                              
  330. Oddly enough, this same type of fractal pattern is shown by several of the
  331. functions programmed into Iterate!--even by functions that algebraically aren't
  332. at all close to each other.
  333.  
  334. Chaos
  335. ─────
  336. Chaos is--well, chaotic.  In a chaotic function, the point jumps around in a
  337. completely unpredictable way.  Mathematicians find chaos fascinating because
  338. these very unpredictable results come from rather simple, predictable-looking
  339. functions.
  340.  
  341. Mathematicians and scientists study mathematical chaos in their search to
  342. understand chaotic behavior in nature: weather patterns, transition states of
  343. materials, the orbits of comets, mixing of materials, population growth, and
  344. many others.
  345.  
  346. To see an example of chaos, choose Function I with the default window and
  347. parameters.
  348.  
  349. Periodic Points
  350. ───────────────
  351. Periodic points are the antithesis of chaos--they are regular, predictible and
  352. orderly.  
  353.  
  354. Periodic points are points that repeat the same path over and over.  The
  355. number of iterations before the point returns to its original position is
  356. called its "period".  For instance, a period 5 point takes 5 iterations to
  357. return to its original position; a period 43 point takes 43 iterations to
  358. return to its original position.  A period 1 point (or fixed point) doesn't go
  359. anywhere--it just stays in its original position without ever moving.
  360.  
  361. Periodic points come in two main varieties: attracting and repelling.  
  362.  
  363. An attracting periodic point pulls nearby points closer and closer to it.  A
  364. attracting fixed point, for instance, sucks in all nearby points like a giant
  365. black hole.  If you iterate a point near it, you might see a spiral, circling
  366. ever closer to the fixed point.
  367.  
  368. A repelling periodic point pushes nearby points away from itself.  If you
  369. iterate a point near a repelling fixed point you might see the point
  370. spiralling outwards.
  371.  
  372. A point can be either strongly or slightly attracting; the same goes for
  373. repelling.  Usually, the points that are only slightly attracting or repelling
  374. are most interesting visually.
  375.  
  376. Believe it or not, a chaotic function has periodic points as well.  However,
  377. they are all repelling periodic points.  This is what makes the function
  378. chaotic.
  379.  
  380. A good way to investigate periodic points is to use the <M> command to trace
  381. out the path of a point.  This makes it much easier to follow the orbit of the
  382. point.  
  383.  
  384. (The path of a point under iteration is called its "orbit" by the way.  A
  385. mathematician would say that Iterate! plots the orbits of points under
  386. iteration.)
  387.  
  388. Using Iterate!, I have found attracting periodic points of period up to 125.
  389. It is possible (with the right function and parameters) to find periodic
  390. points of any period--1000, 1000000, or even larger.
  391.  
  392. Here is a good example: Choose Function E with the default windows and
  393. parameters.  Choose <J> to draw the Julia Set associated with this function.
  394. Now iterate a few points using <Space>.  If you iterate a point inside the
  395. Julia Set, you will see three dark dots appear.  This is a period 3 attracting
  396. point.  Now press <M> repeatedly to trace out the orbit of a point in the
  397. Julia Set.  You will see that for the first few iterations, the point jumps
  398. around the set.  After a while, it settles down and moves closer and closer to
  399. the three attracting points.
  400.  
  401. Approximately in the middle of the three attracting points is a repelling
  402. fixed point.  If you put the cursor near this repelling point and press <M>,
  403. you will see that the point spirals outward.  After it spirals out a ways, it
  404. may be attracted to the period 3 point, or it may leave the Julia Set
  405. altogether.
  406.  
  407. (See "Function.Txt" for more info about Function E and Julia Sets.)
  408.  
  409. Parameters
  410. ──────────
  411. When mathematicians study iteration, one of the main things they study is the
  412. effect of changing the parameters of the function.
  413.  
  414. Let us take a simple function with a single parameter: 1-ax².  In this function
  415. 'a' is the parameter.  What you will discover, if you try this function with
  416. different values for 'a', is that changing the value of 'a' slightly can change
  417. the behavior of the function dramatically.  Some values of 'a' make the function
  418. very nice and well-behaved (one attracting fixed point); others make it wildly
  419. chaotic (an infinite number of repelling periodic points); yet others are
  420. somewhere in between (some attracting periodic points and some some repelling
  421. periodic points).
  422.  
  423. One question mathematicians ask is: "At which value of 'a' does the function
  424. change from well-behavedness to chaos?"  This value is known as a "bifurcation
  425. point."
  426.  
  427. Using Iterate!, you can try changing parameters and observing the results of
  428. these changes. Here is a good example:
  429.  
  430. Choose Function A.  First choose the default window and parameters, and iterate
  431. a few points to see what happens.
  432.  
  433. Then, choose Function A again, but this time enter a=3 and b=3.  (Leave the
  434. other parameters as they are.  You might want to choose a larger graphics window
  435. so you can better see what's going on.)  Again, iterate a few points.  You will
  436. be amazed at the difference this small change makes.
  437.  
  438. You can try different values for 'a' and 'b' between 0 and 3 to see how the
  439. graph gradually changes from order to disorder.  If you're lucky, you might
  440. discover a "bifurcation point"--the parameter value where the large ovals split
  441. to become two smaller ovals.
  442.  
  443. For more information on iteration, fractals, chaos, and bifurcation points,
  444. consult the books listed in the bibliography.
  445.  
  446.  
  447. PROGRAM COMMANDS
  448. ═══════════════════════════════════════════════════════════════════════════════
  449. Iterate! is designed to be pretty much self-explanatory, once you know what it
  450. is supposed to do.  Just in case it isn't, though, here is a list of all the
  451. commands that are available.
  452.  
  453.  
  454. General Notes
  455. ─────────────
  456. Upper or lower case works the same on all commands.
  457.  
  458. Pressing <escape> almost anywhere will abort the command and return you to the
  459. command screen or graphics screen.
  460.  
  461. <F1> shows a help screen, with a brief summary of relevant commands.
  462.  
  463.  
  464. Graphics Screen Commands
  465. ────────────────────────
  466. <Space> or <Left Mouse Button>.  Iterates the point currently at the crosshairs.
  467.  
  468. Note: An iteration can be interrupted by pressing any key besides <Space> or an
  469. arrow, or any mouse button besides <Left Mouse Button>.
  470.  
  471.  
  472. <M>.  Moves the cursor to the next iteration of the point.  By repeatedly
  473. pressing <M>, you can slowly trace out the successive iterations of a point.
  474. This is great for finding periodic points and for any time you want to get a
  475. more detailed idea of what a point is doing.  
  476.  
  477. <M> works better if you hide the graphics screen help line (use the <H>
  478. command).
  479.  
  480. A fun thing to try with the <M> command is to move the mouse as you're
  481. pressing and holding <M>.  This works especially well if you're near an
  482. attracting point.  The mouse move is a "perturbation" of the the point; this
  483. will test how stable the attracting point is.  If the mouse move drives the
  484. cursor away from the attracting point, the attracting point is quite unstable.
  485. If the mouse move drives the cursor momentarily away from the attracting
  486. point, but it soon comes back, then the attracting point is very stable.
  487.  
  488. Note: <M> works much better if the typematic rate on your keyboard is set to a
  489. fast value so that the keys on your keyboard repeat quickly.  Iterate! can do
  490. this for you automatically; see the <G> command for more details.
  491.  
  492.  
  493.  
  494. <H>.  Shows/hides the help line at the top of the graphics screen. 
  495.  
  496.  
  497. <W> or <Right Mouse Button>.  Zooms in on a certain area. Pressing <Ctrl> while
  498. doing this zooms out instead. See the <W> command below for more information.
  499.  
  500.  
  501. <Arrow keys>.  The arrow keys move you around the graphics screen.
  502.  
  503.  
  504. <CapsLock>.  Switches between medium and large steps when you press the arrow
  505. keys.  This key is a toggle--pushing it once will change to large steps, pushing
  506. again will change back to medium steps.
  507.  
  508.  
  509. <Shift>.  When pushed with an arrow key, moves the smallest step possible on
  510. your graphics screen.
  511.  
  512.  
  513. <Esc> or <Middle Mouse Button>.  Switches between the graphics screen and the
  514. command screen.  (Remember that on a two button mouse, pressing both buttons is
  515. the same as pressing the middle button.)
  516.  
  517.  
  518. Basic Commands
  519. ──────────────
  520. <Q>.  Quits the program.
  521.  
  522. <F1>. <F1> shows a help screen (the same thing that is in QuickCmd.txt).
  523.  
  524. <D>.  <D> dumps vital information about your current function and graphics
  525. window to the printer.  This is useful if you have printed a graph (see
  526. "Printing").
  527.  
  528.  
  529. <N>.  Pressing <N> erases the graphics screen so you can start a new graph
  530. (asking you first if you really want to).  If you have points on the iteration
  531. stack, <N> will ask you if you want to delete them or keep them.
  532.  
  533.  
  534. <T>.  Sets the number of iterations to be performed.  This number is used
  535. whether the point is iterated immediately (using <space>) or automatically as
  536. part of the iteration stack (using <I>).  The maximum number of iterations
  537. allowed is 2147483647 (2^31-1, just in case you're wondering).
  538.  
  539.  
  540. <W>.  Sets the graphics window.  This is the area that is shown on the graphics
  541. screen.  'W' works differently depending on whether you are in the graphics
  542. screen or the command screen.
  543.  
  544. * On the Graphics Screen, <W> works like this: Position the crosshair at one
  545. corner of the area you would like to view, and press <W>.  The cursor will
  546. change from a cross to a rectangle.  Move the corner of the rectangle (by using
  547. the mouse or arrow keys) until it encloses the area you want to view.
  548. Press <W> again to complete the window.
  549.  
  550. If you press <Ctrl-W> instead of <W>, you will zoom out instead of zooming in.
  551. That its, in the new graphics window, the present graphics window will look
  552. like area you specified.
  553.  
  554. Remember that pressing <Right Mouse Button> on the graphics screen is the same
  555. as pressing <W>.
  556.  
  557. Note 1: You will notice that Iterate! sometimes rotates the screen 90 degrees--
  558. that is, the y axis becomes the horizontal axis.  Iterate! automatically does
  559. this to accommodate the area you entered--depending on whether it's a short, fat
  560. rectangle, or a tall, thin one.
  561.  
  562. Note 2: Iterate! always expands the windows coordinates to make them fit the
  563. entire graphics screen with the correct aspect ratio.  So you may see a little
  564. more than you specified (but you will never see less).
  565.  
  566. * At the Command Screen, pressing 'W' lets you specify the window coordinates
  567. manually.  Iterate! will ask you for the least and greatest x coordinates, and
  568. the least and greatest y coordinates of the area you want to view.  Then it will
  569. ask you if you want to make the x axis the horizontal coordinate (the usual
  570. way), or the y axis (rotated 90 degrees counter-clockwise from usual).
  571.  
  572. Iterate! will then clear the graphics screen and send you on your way.
  573.  
  574. If you leave all values unchanged, Iterate! will not clear the graphics screen
  575. or change anything.  This provides a handy way to view the values of the current
  576. graphics window.
  577.  
  578. Note: Iterate! will expand the window coordinates you enter to make them
  579. fit the entire graphics screen.
  580.  
  581.  
  582. <F>.  <F> allows you to choose the function Iterate! will use, and specify the
  583. parameters for that function.
  584.  
  585. The functions used by Iterate! take a point on the graphics screen to another
  586. point on the screen.  In other words, a coordinate (x,y) is taken to another
  587. coordinate (x',y').  Mathematicians would say that this is a function R² -> R².
  588.  
  589. The point of this is that our functions must have two parts: one part to tell
  590. where the x coordinate goes to, and one part to tell where the y coordinate goes
  591. to.
  592.  
  593. When you push <F>, you will see a list of the available functions.  A typical
  594. function will look like this:
  595.  
  596.   x -> cos(axy) + bx    y -> sin(cx/y + mu) + dy   (my favorite function)
  597.  
  598. This means that the x coordinate goes to 'cos(axy) + bx' and the y coordinate
  599. goes to 'sin(cx/y) + dy'.  The a, b, c, d, and mu are parameters; you will be
  600. able to enter values for these later.
  601.  
  602. Some of the functions have little comments--"my favorite function" or whatever.
  603. If you want to find out more about the functions than these little comments
  604. tell you, then read "Functions.Txt".
  605.  
  606. The last function (Function U) is a user function.  This is where you can try
  607. out your own functions.  See "THE USER FUNCTION" in this document for more
  608. details.
  609.  
  610. After you enter the function, you enter the parameters.
  611.  
  612. Iterate! will ask you if you want to use the default window and parameters for
  613. this function.  If you haven't tried the function before, using the default
  614. window and parameters is a good idea.  The default window and parameters will
  615. focus you on an interesting area of the plane with some good parameters.  Later,
  616. you can experiment by changing these parameters slightly (or greatly).
  617.  
  618. Many functions only use one or two of the parameters.  In this case, it doesn't
  619. matter what you enter for the rest of the parameters.  I suggest leaving them 
  620. unchanged. HOWEVER, you can enter any value you want in these unused parameters.
  621. This is your big chance to enter the most obnoxious number you can think of 
  622. without the slightest chance of blowing up your CPU.  So go to.  Be anarchic.  
  623. Enjoy yourself for once.
  624.  
  625. Mu is typically used as an angle parameter.  If this is the case, it is entered
  626. in degrees.  (Note: In the User Function, mu is figured in radians, not degrees.
  627. Sorry.)
  628.  
  629.  
  630. <G>.  <G> allows you to adjust various program parameters.  The parameters
  631. you can adjust are:
  632.  
  633. * Aspect ratio.  The aspect ratio is the horizontal size of your CRT (in inches)
  634. divided by the vertical size of your CRT (again in inches).  Unless your monitor
  635. is really weird, the aspect ratio should be 1.333333.  If the aspect ratio is
  636. set wrong, thing will be squashed or stretched on the screen.  For instance,
  637. circles will be squashed or stretched into ellipses.
  638.  
  639. The most common reason you will want to adjust the aspect ratio is to compensate
  640. for your printer--often a printed image will have a different aspect ratio than
  641. it did on the CRT.  Just measure the horizontal and vertical size of a printed
  642. image, figure the aspect ratio (horizontal size divided by vertical size), and
  643. enter it here.  Then your printouts will look nicer.
  644.  
  645. Note: Changing the aspect ratio won't change anything until you enter a new
  646. graphics window (see <W>).  The aspect ratio works by adjusting the boundaries
  647. of the graphics window so that they have the correct proportions.  Iterate!
  648. won't make the necessary adjustments until you enter some new window
  649. coordinates.
  650.  
  651. * Graphics Color.  This determines the color that will be displayed on the
  652. graphics screen.  As a rule, color #15 will produce white.
  653.  
  654. * Text Foreground Color for menus.  A number between 0 and 15. White is 7,
  655. black is 0, bright white is 15.
  656.  
  657. * Text Background Color for menus.  Ditto.
  658.  
  659. Note: If you have a monochrome text adapter (Hercules), the text color
  660. settings will have no effect.
  661.  
  662. * Default Value for "Save Graphics Screen".  This determines whether a "Y" or
  663. "N" comes up whenever the program asks "Save Graphics Screen (Y/N)".  If
  664. you never want to save your graphics screens, change this to "N" and save
  665. yourself a lot of headaches.  If you always spend three hours making a spiffy
  666. graph and then forget to save it, change this to "Y" and save yourself a lot
  667. of headaches.
  668.  
  669. * The text editor to use when editing User Function Files. This changes the text
  670. editor that you use when you press <E> to edit the User Function.  You can use 
  671. your own text editor by entering its name here, or use Iterate!'s built in text
  672. editor by leaving this entry blank.
  673.  
  674. You must enter the full path and filename of the text editor you want to use,
  675. for example "c:\dos\util\edit.exe".  If the path is not complete, or the full
  676. filename isn't used (including the extension), Iterate! won't be able to find
  677. the file.  In this case you will get an error when you use the <E> command to
  678. edit the User Function File.
  679.  
  680. You will need a pretty good chunk of memory free to use this option--about 
  681. 425K plus the amount needed by your text editor.  For this reason, your favorite
  682. gigantic text editor probably won't work here.  For instance, "Edit.com" that 
  683. comes with DOS probably won't work--it's way too huge.  I use "Ted.com", a
  684. little shareware text editor, and it works great.  If your text editor is too
  685. big, you can probably find a more compact one on a local BBS (or just put up
  686. with Iterate!'s built in editor).
  687.  
  688. Make sure the editor you use here returns just plain old DOS text--otherwise
  689. Iterate! will get real confused.  Don't try to use WordPerfect or something like
  690. that.
  691.  
  692. * Set keyboard repeat rate on startup.  If this option is marked "Y", Iterate!
  693. will automatically set the repeat rate to its fastest possible value at
  694. startup.  This dramatically speeds up keyboard response when using the arrow
  695. keys to move or the <M> command to trace an iteration.  If this option is
  696. marked "N" then the keyboard repeat rate is left unchanged.  
  697.  
  698. (Note that the "KBrepeat.exe" utility included with Iterate!  allows you to
  699. change to keyboard repeat rate from the DOS command line--either to recover
  700. from what Iterate!  has done to you, or just to change it however you want.
  701. Unfortunately, it is impossible to detect the setting of the keyboard repeat
  702. rate, so Iterate! can't return the repeat rate to the state it was before it
  703. started.  If you don't like the repeat rate Iterate! leaves you with--the
  704. fastest possible setting--you can use KBRepeat to change it the way you want.)
  705.  
  706. Iterate! saves the all these parameters and defaults (as well as the default
  707. User Function Filename and the default color for drawing Julia Sets) in a file
  708. named "Iterate!.ini".  "Iterate!.ini" is located in the directory that
  709. Iterate! is in.
  710.  
  711. If you get the colors too goofed up (you can't read text screens or
  712. see the graphics screen, for instance), just delete "Iterate!.ini".
  713. Everything will return to its default value.  Any time, in fact, the program
  714. is acting a little strange, it might be a good idea to delete the
  715. "Iterate!.ini" file.  Doing this restores all these settings to their
  716. "factory pre-sets".
  717.  
  718.  
  719. Special Commands for Julia/Mandelbrot Sets 
  720. ──────────────────────────────────────────
  721. These two commands are designed to be used with Function E, the function that
  722. draws Julia Sets.  Using these commands along with Iterate!'s usual commands
  723. and the file "Mandelbr.gph" gives a powerful method of investigating the
  724. properties of Julia Sets.  See "Function.txt" under Function E for more
  725. details.
  726.  
  727. <J>.  The <J> command only works if Function E is selected as the current
  728. function.  <J> draws the Julia Set associated with Function E and the current
  729. parameters.
  730.  
  731. Pressing <J> is exactly the same as selecting Function F, retaining graphics
  732. window and parameters, iterating a point 10000 times, and then changing back
  733. to Function E. Using <J>, however, is much easier than doing all that.  You
  734. will want to use <J> whenever you are working with Function E.  See
  735. "Function.Txt" for more information.
  736.  
  737.  
  738. <Z>.  Zips the coordinates of the graphics screen into the parameters.  The x
  739. value of the screen coordinate becomes parameter 'a' and the y value becomes
  740. parameter 'b'.  You are presented with a menu with these new values, and have
  741. the opportunity to change any of the parameters or window coordinates before
  742. accepting the new values.
  743.  
  744. <Z> is designed to be used with Function E and the file "Mandelbr.gph".
  745. Here's how you should use it.
  746.  
  747.     1. Use the <F> command and choose Function E.
  748.     2. Use the <R> command and load "Mandelbr.gph".
  749.     3. Move the cursor to any spot in or near the Mandelbrot Set.
  750.     4. Press <Z> to load these coordinates as the parameters.
  751.     5. Press <J> to draw the Julia Set associated with these parameters.
  752.     6. Use <Space> and <M> to investigate the properties of Function E with
  753.        these parameters.
  754.     
  755.  
  756.  
  757.  
  758. DOS Commands
  759. ────────────
  760. <S>.  <S> saves the current graphics screen.  A saved picture take between 
  761. 16,000 bytes (CGA mode) and 170,000 bytes (VGA2 mode) of disk space.
  762.  
  763. Iterate! asks for a file name WITHOUT the extension. The reason for this is that
  764. when you save your graph, Iterate! actually makes two files, one with the
  765. extension ".gph" and the other with the extension ".inf".  The ".gph" file is
  766. the actual graphics screen, while the ".inf" file contains information about the
  767. graph (which function is used, parameters, graphics window, iteration stack,
  768. etc.).
  769.  
  770. If you're short on disk space, you might try running the program in CGA or
  771. Hercules Graphics mode (if your graphics card is compatible with one of these),
  772. because saving a graph created in these modes takes much less disk space than
  773. one created in EGA or VGA modes.  See "GRAPHICS MODES" below for more details.
  774.  
  775. Iterate! saves the screen in its own proprietary graphics format (don't tell
  776. anybody, but actually it's nothing but a massive memory dump).  So it isn't
  777. compatible with any other graphics file formats.  Sorry.  If you really want to 
  778. save your beautiful screens in a graphic format such as .bmp or .gif, there are 
  779. screen grabber utilities around that will do it.  Or if you have a 386 or better
  780. and run Windows in advanced mode, you can run Iterate! in a window, hit <Alt-
  781. PrintScreen> to copy the window to the clipboard, and then paste the window into
  782. PaintBrush (Ctrl-V).  There you can print it or save it to your heart's delight.
  783.  
  784. <R>.  <R> retrieves a graphics screen that you have previously saved.  
  785.  
  786. One warning: don't try to retrieve a graphics screen that you saved in a 
  787. different graphics mode.  Iterate! isn't able to change graphics modes in mid-
  788. stream, and take my word for it--your graph will look pretty darn funny.  If you
  789. want to retrieve such a graphics screen, you will have to re-start Iterate! in 
  790. the graphics mode you saved it in. (See the section below on "Graphics Modes"
  791. for more information on how to do this.)
  792.  
  793.  
  794. <X>.  <X> lists the files in the directory you specify.
  795.  
  796.  
  797. <O>.  <O> shells out to the operating system.  Once you have shelled out, type
  798. "exit" to return to Iterate!.
  799.  
  800. This command is very useful.  You can leave the program for a moment to do some
  801. housekeeping--copy or erase files, for instance--and then return to Iterate!
  802. with everything still intact.
  803.  
  804. Iterate! won't be able to shell to DOS if there is insufficient memory.  If you
  805. have about 300K-350K free when you start Iterate!, you should be safe.
  806.  
  807.  
  808. Iteration Stack Commands
  809. ────────────────────────
  810. Iterate! provides a stack of iteration points that can be iterated in sequence,
  811. automatically.  Several commands allow you to enter points on the stack and then
  812. iterate them.
  813.  
  814. The idea behind the iteration stack is this: Suppose you are investigating a
  815. function, and you are looking at a rather high magnification so that it takes
  816. 200000 iterations of each point just to get a clear picture on your screen.
  817. If you had to enter each point individually and wait for 200000 iterations, it
  818. would take forever.  But, using the iteration stack, you can enter 40 points
  819. all at once, and then set them to iterating automatically.  When you wake up
  820. the next morning, your spiffy picture will be all done.
  821.  
  822. Also, you can interrupt the automatic iteration process (just press any key when
  823. it is iterating and it will stop).  If you then press <I> again, the automatic 
  824. iteration will resume where it left off.
  825.  
  826. Another advantage of the iteration stack is that you can save an interrupted
  827. iteration.  Iterate! saves information about the iteration stack in the ".inf"
  828. file.  So you can interrupt an automatic iteration, and save it, then later
  829. retrieve it and continue where you left off.
  830.  
  831. Yet another advantage (wow! isn't this a really great feature?) is that Iterate!
  832. keeps track of the endpoint of each iteration point on the stack (i.e., where
  833. the point ended up after it was iterated).  You can add the endpoints back
  834. onto the iteration stack and continue iterating them.
  835.  
  836. So suppose you've iterated 40 points on the iteration stack 20000 times each.
  837. You decide this isn't enough--you need to iterate them another 20000 times.
  838. This is easy--you just add the endpoints onto the stack (using the <C> command),
  839. and iterate them another 20000 times.
  840.  
  841.  
  842. Here are the iteration stack commands:
  843.  
  844. <A>. <A> automatically adds points to the iteration stack.  The points added by
  845. <A> are in a rectangular array, evenly spaced around the current graphics
  846. window.  When you press <A>, Iterate! will ask you how many points you want in
  847. the X direction, and how many in the Y direction.  If you enter the defaults of
  848. '7' and '6', this will enter 42 points, in a rectangular array on the screen.
  849.  
  850.  
  851. <P>. <P> allows you to individually enter points to the iteration stack.  <P>
  852. works differently, depending on whether you're on the graphics screen or the
  853. command screen when you press it.
  854.  
  855. Pressing <P> on the graphics screen enters the point at the crosshairs to the
  856. iteration stack.
  857.  
  858. Pressing <P> at the command screen allows you to enter points by typing in the x
  859. and y values.  This is kind of a pain (I don't recommend that you do this
  860. often), but it's useful if you want to enter a specific value (i.e., x=3.1416
  861. y=19823.245224349546129524).
  862.  
  863.  
  864. <C>.  <C> adds the endpoints of the points you specify onto the stack.  This
  865. way, you can add further iterations to these points.  You have three options for
  866. the endpoints you want to add:
  867.  
  868. 1. Add endpoints of all points on the iteration stack.
  869.  
  870.    This, of course, does just what it says.
  871.  
  872. 2. Add endpoints of the last batch of points iterated.
  873.  
  874.    The "last batch" means the points that were iterated the last time you pushed
  875.    <I>.  Usually, this is the option you want.
  876.  
  877. 3. Add endpoints of the points you specify by number.
  878.  
  879.    Iterate! numbers the points on the stack, starting naturally with 1.  You can
  880.    see how the points are numbered, as well as the X and Y values of the points
  881.    by pressing <L>.
  882.  
  883.    Using this option, you must enter the number of the first point and the
  884.    number of the last point you want to continue iterating.  Use this option
  885.    only if for some reason you want to continue iterating only one or two
  886.    specific points.
  887.  
  888.  
  889. <L>. <L> lists all points on the iteration stack: their point number, X value,
  890. and Y value, and the X and Y value of their endpoints.  <L> also gives other
  891. relevant information on the iteration stack: how many points are on the stack,
  892. how many have been iterated, and which points were iterated in the last batch.
  893.  
  894.  
  895. <I>. <I> iterates the points on the iteration stack.  Each point is iterated the
  896. number of times you specified with the <T> command.
  897.  
  898. You can interrupt <I> by pressing any key.  Resume where you left off by
  899. pressing <I> again.
  900.  
  901.  
  902. User Function Commands
  903. ──────────────────────
  904. <U>.  <U> allows you to test the user function.  Just enter the X and Y values
  905. you want to evaluate, and Iterate! shows the X and Y values the user function
  906. returns.  (See the section on "USER FUNCTION" for more details.)
  907.  
  908.  
  909. <E>.  <E> allows you to edit the current user function file.
  910.  
  911. You are first presented with a menu that allows you to choose the User Function
  912. Filename.  You can choose one of the pre-existing files, or type in a new name
  913. if you want to start a new User Function File.  Your User Function should end
  914. with ".frm"; Iterate! changes the extension to ".frm" no matter what you try
  915. to put in.
  916.  
  917. The User Function Filename you select here becomes the default User Function
  918. Filename--this file will be used as the User Function File until you press <E>
  919. and select a different file.
  920.  
  921. After you have selected the User Function File, you can edit it.  Change it any
  922. way you want, and press <Enter> when you're done.  (See the section below on
  923. "The User Function" for more info on how to do this.)
  924.  
  925. When you finish editing the file, Iterate! reads the file in as the current user
  926. function, sets the Function to U, changes the Parameters to the default
  927. parameters in the function file, and changes the Graphics Window to the default
  928. graphics window entered in the function file.
  929.  
  930. In other words, after you edit the function file, Iterate! sets you up to try
  931. out your changes (why else would you have been editing it?).
  932.  
  933. By default, Iterate! uses its own small built in text editor.  With this
  934. editor, you are limited to a 22 lines of 75 characters each.  For most User
  935. Function Files, this should be more than sufficient.  However, if you want to
  936. be able to edit longer files, or if you have another (small) text editor you
  937. like better, Iterate! allows you to specify a text editor to use in editing
  938. the User Function File.  Just use the <G> command (see the <G> command above
  939. for more details).
  940.  
  941. Warning: Any file you edit with Iterate!'s built in User Function Editor will
  942. truncate the file at 22 lines of 75 characters each.  If you inadvertently
  943. load a longer file into the User Function Editor, just use <Esc> to back out
  944. and your file will be unharmed.
  945.  
  946. See the section on "USER FUNCTION" for more details about how to make your own
  947. User Function Files.
  948.  
  949.  
  950.  
  951. Edit Menu Commands
  952. ──────────────────
  953. Whenever you're in an edit menu, the following commands are operative:
  954.  
  955. <Enter> or <Left Mouse Button> accepts all values.
  956.  
  957. <Esc> or <Right Mouse Button> aborts and sends you back to the command screen.
  958. All values revert to their previous state.
  959.  
  960. <F1> returns the current field to its default value (what it was before you
  961. started typing).
  962.  
  963. <Ctrl-End> deletes from the current cursor position to the end of the field.
  964.  
  965. <Ctrl-Home> deletes from the current cursor position to the beginning of the
  966. field.
  967.  
  968. All the other keys work pretty much the way you'd expect them to.
  969.  
  970.  
  971. THE USER FUNCTION
  972. ═══════════════════════════════════════════════════════════════════════════════
  973. One of the spiffiest features of Iterate! (if I do say so myself) is the user
  974. function.  The User Function allows you to enter your own function in a User
  975. Function File.  The program then treats this function just like any other
  976. function--you can choose it, set parameters, and iterate it.
  977.  
  978. Using the <F> command and choosing Function U makes the User Function the
  979. current function.
  980.  
  981. The first time you use Iterate!, the User Function File is named
  982. "Iterate!.frm".  You can use the <E> command to select different User Function
  983. File, edit the current User Function File, or make a new User Function File.
  984.  
  985. Several examples of user functions are distributed along with Iterate!.  These
  986. all have the extension ".frm".  To try out these formulas, just choose <E> and
  987. select the file you want to try.  I suggest looking these over to see what
  988. kinds of things you can do with the User Function; this will probably tell you
  989. more about programming user functions than what I'm about to say.
  990.  
  991. User Function Files are just plain old text files, so if you're not in
  992. Iterate!, you can edit them with any text editor, such as "Edit" that is
  993. distributed along with DOS.  
  994.  
  995. If you don't like Iterate!'s built in User Function File Editor, you can use
  996. your own text editor to edit User Function Files from within Iterate!.  See
  997. the <G> command above for more info.
  998.  
  999. Iterate! pre-processes the User Function so that it is quite fast--only
  1000. 60-80% slower than the built in functions.  Not bad, considering that the
  1001. built in functions are compiled while the User Function is interpreted.
  1002.  
  1003. If you come up with a good function file, I am interested in hearing about it.
  1004. Send me a disk or printout, or use e-mail.  I will distribute the best User
  1005. Function Files (with credit given where due, of course) with future versions
  1006. of Iterate!.
  1007.  
  1008. All right, now down to the nitty-gritty . . .
  1009.  
  1010. The User Function File
  1011. ──────────────────────
  1012. Here's an example of a typical user function file:
  1013.  
  1014. ................................................................................
  1015.        ;This is the name. It will be displayed at the <F> command.
  1016.        N X= cx + cos(ay) + sin(mu x)  Y= dy + sin(bx)
  1017.  
  1018.        ;These are the default values for the parameters
  1019.        a=1
  1020.        b=.5
  1021.        c=1
  1022.        d=1
  1023.        mu=.2
  1024.  
  1025.        ;These are the default values for the graphics window
  1026.        xmin=-20
  1027.        xmax=20
  1028.        ymin=-20
  1029.        ymax=20
  1030.  
  1031.        ;This is the actual function
  1032.        x= c*x + cos(a*y) + sin(mu*y)
  1033.        y= sin(b*x) + d*y
  1034. ................................................................................
  1035.  
  1036. The file consists of three parts: The name, the defaults, and the function.  The
  1037. three parts can be in any order.  The name and the defaults are optional.
  1038. Only the function is required.
  1039.  
  1040. General Notes:
  1041.  
  1042. All leading and trailing blanks are ignored.
  1043.  
  1044. Comments can be entered by starting the line with a semi-colon.
  1045.  
  1046. Anything the formula interpreter doesn't understand is simply ignored; you may
  1047. or may not get an error message when the program reads in the function file.
  1048.  
  1049. Upper and lower case can both be used; it makes no difference.
  1050.  
  1051.  
  1052. >The name<
  1053. The name is totally optional. If you don't enter a name, the program will
  1054. automatically make a name from the function formulas you entered.
  1055.  
  1056. Suppose, however, that you don't want your formula to have just a plain vanilla
  1057. algebraic name.  Suppose you want it to have a really spiffy name like
  1058. 'Phred's Phantastic Phormula Phor Phabulous Zucchini Phry Bread'.  Well, unless
  1059. you took a very different algebra class than I did, this name really isn't
  1060. going to work out as your function formula.  So the name line lets you specify
  1061. 'Phred's Phantastic Phormula .  . .', or whatever else you might want, as the
  1062. name.
  1063.  
  1064. Begin the name line with 'N'.  Everything after that is the name of the
  1065. function.  Spaces between the 'N' and the next character are ignored.
  1066.  
  1067. The name can be at most 75 characters long.  If the name is too long, it will
  1068. cause weird things to happen to the display.
  1069.  
  1070.  
  1071. >The defaults<
  1072. These are the parameters and window settings that will be entered if the user
  1073. wants the default parameters and windows settings.  If you edit the User
  1074. Function File using the <E> command, these parameter and window settings will
  1075. be automatically entered as the parameters and window when you're done editing.
  1076.  
  1077. The lines beginning with a=, b=, c=, d=, and mu= refer to parameters.  The lines
  1078. beginning with xmin=, xmax=, ymin=, and ymax= refer to the graphics window.
  1079.  
  1080. The defaults are totally optional.  Some, all, or none of them may be entered.
  1081. However, they are nice for the user (and even yourself), because the values can
  1082. be ever after entered automatically if you set them once in the file.
  1083.  
  1084. All 9 possible defaults are shown in the example above.  Each must be on a line
  1085. of its own.  Spaces are allowed anywhere as "window dressing"; they will be
  1086. ignored.
  1087.  
  1088. The number you enter after the equals sign must be able to be interpreted by
  1089. TurboPascal as a real number.  Otherwise, it will be interpreted as '0'.
  1090.  
  1091. A few examples:
  1092.  
  1093.        Example       Remark
  1094.        ─────────     ──────────────────────────────────────────────────────
  1095.        a = 1.09      OK
  1096.        mu= -3.43     OK
  1097.        xmax=1e9      OK--this means 1*10^9
  1098.        y min= 1 0    OK (But c'mon--try to learn how to type. It's not that
  1099.                      hard)
  1100.        b=i89         Bad--Pascal can't interpret 'i', so sets b=0
  1101.        c=x           Sorry, won't work.  Try a real number instead.
  1102.  
  1103.  
  1104.  
  1105. >The function<
  1106. This is the trickiest part.
  1107.  
  1108. The 'x=' introduces the x part of the function, the 'y=' introduces the y part
  1109. of the function (for the reason there are two parts to the function, read above
  1110. under the <F> command).
  1111.  
  1112. The functions are entered in the usual algebraic notation. Spaces are allowed,
  1113. but they are "just for looks" and will be ignored.
  1114.  
  1115.        Example                Remark
  1116.        ────────────────       ───────────────────────────────────
  1117.        y = cos(x*y)           All these lines will be interpreted
  1118.        y=cos(x*y)             the same way
  1119.        y= cos ( x * y )
  1120.  
  1121.  
  1122. The function must be on one line.  However, this line can be up to 255
  1123. characters long.  (Iterate!'s built in text editor only allows lines of 75
  1124. characters, so if you want to enter functions longer than 75 characters, you
  1125. must use your own text editor to edit the User Function File.  Remember that
  1126. you can use the <G> command to change the text editor Iterate! uses.)
  1127.  
  1128. Here are the things you can enter in a function:
  1129.  
  1130.   Item                 Example         Remark
  1131.   ───────────────────  ──────────────  ────────────────────────────────────────
  1132.   Variable             x y             The value of x or y
  1133.   Parameter            a b c d mu      The current value of this parameter
  1134.   Constants            e pi            Enters the value of these constants
  1135.   Numbers              5 1e3 .35       Must be able to be interpreted by
  1136.                                        TurboPascal as a number
  1137.   functions            cos sin (etc.)  Performs the operation--a complete list
  1138.                                        of recognized functions follows
  1139.   algebraic operators  + - * / ^       Performs the operation
  1140.   Parentheses          ( )             Iterate! can handle as many nested
  1141.                                        parentheses as you can fit on a line.
  1142.                                        (It can handle up to 500 pending
  1143.                                        operations.  If anybody can figure out
  1144.                                        how to get 500 pending operations on a
  1145.                                        line with 255 characters, I'd like to
  1146.                                        hear about it!)
  1147.  
  1148.  
  1149. This is a list of all operations available in the User Function.
  1150.  
  1151.   Name    Remarks
  1152.   ─────── ────────────────────────────────────────────────────────────────────
  1153.   *       Multiplication
  1154.   /       Division
  1155.   +       Addition
  1156.   -       Subtraction (Note: '-' in front of a number, variable, or parameter
  1157.           gives the additive inverse, just as you'd expect.  That is, -3--1=-2,
  1158.           and -x+y is the same as y-x.  You'd better appreciate this, because,
  1159.           believe me, it was a big pain to program.  Whoever invented
  1160.           mathematics ought to be shot for allowing one symbol to stand for
  1161.           two different things.)
  1162.           (See also Note 5.)
  1163.  
  1164.   ^       Exponentiation, i.e. 2^3=8
  1165.   #       Integer division, i.e. 12#5=2, 21#4=5, 100#49=2.  Division by zero
  1166.           returns 0, i.e. 100#0=0.
  1167.   |       Modulus, that is, a|b is the remainder of a/b.  For instance 12|5=2,
  1168.           21|4=1, 100|49=2.  x|0=0 for all x.
  1169.  
  1170.   sqr     the square of the number, i.e. sqr(10)=100. Sqr(x) should be faster
  1171.           than x*x
  1172.   sqrt    the square root of the number, i.e. sqrt(100)=10.  Sqrt of a
  1173.           negative number returns 0.
  1174.  
  1175.   sin     All trig functions are calculated in radians
  1176.   cos
  1177.   tan
  1178.   cot
  1179.   sec
  1180.   csc
  1181.   arcsin  Results of inverse trig functions are given in radians
  1182.   arccos
  1183.   arctan
  1184.   arccot
  1185.   arcsec
  1186.   arccsc
  1187.  
  1188.   sinh    Hyperbolic trig functions.  These functions have tendency to return
  1189.   cosh    very large and very small numbers.  Any result larger than 1e16
  1190.   tanh    is simply truncated to 1e16.  Any result smaller than about 1e-16
  1191.   coth    is simply set to 0.
  1192.   sech
  1193.   csch
  1194.   arcsinh
  1195.   arccosh
  1196.   arctanh
  1197.  
  1198.   e       enters the value of e=2.71828...
  1199.   pi      enters the value of pi=3.141592...
  1200.  
  1201.   exp     exponential of the number, i.e. exp(1)=2.71828, exp(2)=7.38905
  1202.   exp10   10 to the power of the number, i.e. exp10(1)=10, exp10(2)=100
  1203.   logn    natural log, i.e. logn(e)=1.  Logn of a negative number returns 0.
  1204.   log     log base 10, i.e. log(10)=1.  Log of a negative number returns 0.
  1205.  
  1206.  
  1207.   inv     multiplicative inverse, i.e. inv(x)=1/x.  This should be faster,
  1208.           however, than 1/x
  1209.   neg     additive inverse, i.e. neg(cos(x))=-cos(x).  Use 'neg' instead of '-'
  1210.           if you wish to restore symbolic purity to mathematics and keep
  1211.           programmers out of the loony bin.  Just as fast as '-', might
  1212.           work more reliably, and it's _unambiguous_.
  1213.   abs     absolute value, i.e. abs(3)=3, abs(-3)=3
  1214.   sgn     the sign of the number, i.e. sgn(10)=1, sgn(-10)=-1, sgn(0)=0
  1215.   int     next integer smaller in absolute value, i.e. int(1.4)=1, int(-3.5)=-3
  1216.   round   rounds to the nearest integer, i.e. round(2.1)=2, round(3.6)=4,
  1217.           round(10.7)=11.  .5 rounds to the next larger integer in absolute
  1218.           value, i.e. round(2.5)=3, and round(-2.5)=-3
  1219.  
  1220.   rn      a random real number between 0 and 1 (more precisely, rn may equal
  1221.           zero, but will always be less than 1)
  1222.   intran  a random whole number less than the argument and greater than or equal
  1223.           to zero, i.e. intran(10) is somewhere in the range 0..9
  1224.           (Actually I have heard that there is a bug in the TurboPascal random
  1225.           number generator that will make rn=1 and intran(10)=10 two times or
  1226.           so out of every billion.  If this disturbs you, I suggest that you
  1227.           write a nasty letter to Borland.)
  1228.  
  1229. NOTES:
  1230. 1. Normal algebraic precedence of operation is used:
  1231.  
  1232.       Function     Precedence
  1233.       ──────────   ───────────────────────────────────────────────────────────
  1234.       sin, cos,    1 highest precedence (P.S. also includes '-' when used as a
  1235.       all other                          unary operator--did I tell you it was
  1236.       unary                              a pain?)
  1237.       functions
  1238.       
  1239.       ^            2
  1240.       *,/,#,|      3
  1241.       +,-          4 lowest precedence
  1242.  
  1243.  
  1244. 2. The User Function Interpreter attempts to prevent overflow errors.  If the
  1245. absolute value of x or y is greater than 1e16, the function simply does not
  1246. calculate--x and y are left unchanged.  If your function is really wild, though,
  1247. you could possibly generate overflow errors.  If this happens, the program will
  1248. stop and display a runtime error.
  1249.  
  1250. 3. The Interpreter also attempts to prevent division by zero errors.  If
  1251. division by zero is attempted (or anything similar such as cot(0)), 1e16 is
  1252. simply substituted as the result.
  1253.  
  1254. 4. Some functions are undefined for negative numbers (sqrt, log, logn).  If
  1255. you input a negative number into these functions, they will simply return 0.
  1256. This is again to prevent runtime errors that would halt the program.  The
  1257. problem with this, however, is it can give unexpected results--the function
  1258. looks like it is doing something, when really it is in an area where the
  1259. function isn't even defined.  I suggest using the 'abs' function in
  1260. conjunction with these functions, i.e., use sqrt(abs(x)) instead of just
  1261. sqrt(x).  Or just don't use points that will give a negative result.  At
  1262. any rate, be a little wary of results using these functions.
  1263.  
  1264. 5. One thing the Function Interpreter will not handle is things like this:
  1265.  
  1266.        --(x+5), --x, y+--x
  1267.  
  1268. As you can see, there is a double (unary) negative sign in each of these
  1269. functions.  Don't use this, as it will give unexpected results. (Don't ask
  1270. me WHY you would want to do this anyway, but I'm sure there is somebody
  1271. out there who is going to be bitterly disappointed that they won't be able
  1272. to put a bunch of superfluous minus signs in all their functions.)
  1273.  
  1274. The Function Interpreter WILL handle things like this:
  1275.  
  1276.        x--5, -(-(-x+-5)), neg(neg(neg(-5))), x--(-5--y)
  1277.  
  1278. Notice that there are double minus signs here, but in every case, one of them
  1279. is a binary minus sign (subtraction) and the other is unary minus sign
  1280. (negative sign).  Two or more unary minus signs in a row is what the Function
  1281. Interpreter can't handle.
  1282.  
  1283. Here are some examples of functions, just to give you an idea of the types
  1284. of things you can do.
  1285.  
  1286.   Example                 Remark
  1287.   ──────────────────────  ───────────────────────────────────────
  1288.   x=x*sin(a*y/x^5)        Normal algebraic precedence is observed
  1289.   y=y/-a*log(x*(y+b))     Nested parentheses allowed
  1290.   x=x + CSC (Y)           Spaces are OK; upper case is OK
  1291.   y=(x+y)*pi
  1292.   x= rn * abs(x)
  1293.   y= y | intran(5)
  1294.   x= y # x
  1295.   y= log(e * x)
  1296.   x= sin(x*pi/180)
  1297.   y= sgn(a*x+b*cos(y))#x
  1298.  
  1299.  
  1300. User Function Error Messages
  1301. ────────────────────────────
  1302. Iterate! tries to detect errors in the function file and give helpful error
  1303. messages.
  1304.  
  1305. Iterate! reads the User Function on three occasions:
  1306.  
  1307.       1. When you start the program
  1308.       2. When you return from a DOS shell
  1309.       3. After you use the <E> command to edit the User Function File
  1310.  
  1311. So these three occasions are when you may see error messages related to the User
  1312. Function File.
  1313.  
  1314. Because of the way Iterate! processes the function file, it is difficult to
  1315. point out after the fact exactly where the error occurred.  So you have to take
  1316. Iterate!'s error messages with a little grain of salt.  If Iterate! says the
  1317. error occurred at "cosx", then the error probably happened at or near "cos" or
  1318. "x" in your file.
  1319.  
  1320. If an error occurs, you will still be able use the User Function (of course it
  1321. may not be working properly!).
  1322.  
  1323. On the other hand, it is possible that Iterate! won't give you an error, but the
  1324. function still won't be working properly--either because Iterate! thinks it
  1325. understands something that it really doesn't, or simply because you didn't enter
  1326. what you really meant.
  1327.  
  1328. This could create problems, but the solution is really quite simple: Use
  1329. the <U> command to test your function.  Calculate a couple of values by hand,
  1330. and then enter these same values at the <U> command.  If you get the same
  1331. answers as you did by hand, you can be pretty darn sure that the function is
  1332. working right.
  1333.  
  1334.  
  1335. GRAPHICS MODES
  1336. ───────────────────────────────────────────────────────────────────────────────
  1337.  
  1338. Automatic detection
  1339. ───────────────────
  1340. Iterate! automatically detects CGA, EGA, VGA, and Hercules graphics and starts
  1341. you in the right graphics mode.
  1342.  
  1343. If you don't have one of these adapters, or if Iterate! can't detect which
  1344. adapter you have, it will kick you into a graphics menu when you first start the
  1345. program.  You can manually choose your graphics adapter and mode.  Just type the
  1346. number of the proper graphics adapter and mode when they are requested.
  1347.  
  1348. Because it is impossible to tell which graphics adapters might be compatible
  1349. with which graphics modes, the program puts no restrictions on which adapter you
  1350. may choose.  If you choose an incompatible adapter, however, you might hang your
  1351. computer. If this happens, try pushing <Ctrl-Break> to exit the program. If this
  1352. doesn't work, you will just have to reset the computer.
  1353.  
  1354. >Choosing graphics mode at the command line<
  1355. If you don't like the mode Iterate! puts you in automatically, you can specify a
  1356. different graphics mode from the DOS command line. These command line options
  1357. are available:
  1358.  
  1359.      Command             What it does
  1360.      ─────────────       ───────────────
  1361.      Iterate! CGA        CGA mode 4
  1362.      Iterate! EGA        EGA mode 2
  1363.      Iterate! Herc       Hercules mode 0
  1364.      Iterate! VGA        VGA mode 1
  1365.      Iterate! VGA0       VGA mode 0
  1366.      Iterate! VGA1       VGA mode 1
  1367.      Iterate! VGA2       VGA mode 2
  1368.      Iterate! Man        Allows you to manually choose graphics modes
  1369.  
  1370. There should be a space (not a slash, dash or anything else) after Iterate! and
  1371. before the command line option.  Upper or lower case is OK.
  1372.  
  1373. Compatibility
  1374. ─────────────
  1375. Iterate! has been thoroughly tested with CGA, EGA, VGA, and Hercules graphics
  1376. adapters, and should work fine if you have one of these. If you have anything
  1377. else, it might work, but I don't guarantee anything!
  1378.  
  1379. If you can't get the program to work any other way, you might try CGA, EGA, or
  1380. VGA mode. Most graphics adapters are compatible with one of these.
  1381.  
  1382. Memory restrictions on graphics mode
  1383. ────────────────────────────────────
  1384. Iterate! Saves your entire graphics screen to memory when it switches to text
  1385. mode.  As you can well imagine, this takes a huge chunk of memory--around
  1386. 170,000 bytes for VGA2 mode (640x480, 16 colors).
  1387.  
  1388. At startup, Iterate! reserves about 180,000 bytes for storing the graphics
  1389. screen.
  1390.  
  1391. So what's the point?  If the graphics mode you choose requires more than 180,000
  1392. bytes of storage, choosing that mode will generate a run-time error (a heap
  1393. overflow error, just in case you're interested).
  1394.  
  1395. So . . . . . . don't choose a graphics mode that requires more than 180K of
  1396. memory!  Anything with a resolution of more than 640x480 or with more than
  1397. 16 colors is likely to require more than this.
  1398.  
  1399. You're welcome to give higher resolution/color modes a try.  You won't hurt
  1400. anything. If you run into problems, just choose a lower resolution mode or a
  1401. mode with less colors.
  1402.  
  1403. 256 colors won't do you any good in this program anyway!  It's all 2 colors--
  1404. black and white.  Anything more than that just bogs things down and makes the
  1405. save files that much bigger.
  1406.  
  1407.  
  1408. MOUSE
  1409. ═══════════════════════════════════════════════════════════════════════════════
  1410. The mouse utilities I used in Iterate! will supposedly work with any Microsoft
  1411. compatible mouse.  I have tested it with GMouse (the Genius Mouse Driver)
  1412. version 8.08, Logitech's Mouse Driver version 6.12, and Microsoft Mouse
  1413. Driver version 8.10.
  1414.  
  1415. If the mouse doesn't work right with Iterate!, you can try a few of things:
  1416.  
  1417.    * Get an updated mouse driver.  Your older mouse driver might not be
  1418.      compatible with newer video modes or a later Microsoft mouse standard.
  1419.      You should be able to get an updated mouse driver from the manufacturer
  1420.      or the place you bought the mouse.  Sometimes manufacturers distribute
  1421.      updates electronically; you may be able to find a driver that works on a
  1422.      local BBS.
  1423.  
  1424.    * Just use the keyboard.  You can do anything with the keyboard you can do
  1425.      with the mouse (OK, OK, it's not as much fun, but that's the breaks, kid).
  1426.  
  1427.    * Prevent Iterate! from using the mouse by typing "Iterate! nomouse" at the
  1428.      command line.  Then just use the keyboard.  You should try this if you're
  1429.      unable to make the cursor move to all parts of the graphics screen; the
  1430.      problem in this case is the mouse driver, not Iterate!.
  1431.  
  1432.    * Report the problem to me.  Especially if you're a registered user (!!) I
  1433.      might be able to figure something out.
  1434.  
  1435.  
  1436. One little mousey bug: if you are moving the mouse when you start the program
  1437. (when Iterate! is running its mouse initialization routines), Iterate! won't
  1438. recognize the mouse and you won't be able to use it.  This seems to be a bug
  1439. in the mouse driver itself, or in the mouse utilities I am using.  Sorry.
  1440.  
  1441.  
  1442. PRINTING
  1443. ═══════════════════════════════════════════════════════════════════════════════
  1444. For printing your creations, I suggest using "Graphics.exe" or "Graphics.com"
  1445. that comes with your copy of DOS.
  1446.  
  1447. Just type "Graphics" at the DOS prompt, before starting Iterate! (Make sure
  1448. Graphics.exe or Graphics.com is in your current directory or path. Usually, it
  1449. is found in the DOS subdirectory, which is in usually in your path, so just
  1450. typing "Graphics" will work.)
  1451.  
  1452. Then, when you're in Iterate!, press <Shift-PrintScreen>, and whatever you're
  1453. looking at will be printed out to your printer.
  1454.  
  1455. If this doesn't work, check your DOS documentation under "Graphics" or your
  1456. printer documentation under "Printing the Graphics Screen."
  1457.  
  1458. If you have a 386 or better computer, it is also possible to print a graphics
  1459. screen using Windows.  Run Windows in advanced mode, and then run Iterate! in
  1460. a window.  Then <Alt-PrintScreen> will copy the current window to the
  1461. clipboard.  You can run your favorite graphics program, paste the Clipboard
  1462. into it, and print from there.
  1463.  
  1464.  
  1465. RUNTIME ERROR MESSAGES
  1466. ═══════════════════════════════════════════════════════════════════════════════
  1467. On some (hopefully very rare) occasions, Iterate! will terminate abnormally
  1468. because of an unexpected runtime error.  If this happens, Iterate! will present
  1469. you with a screen telling you the type of error that happened and (if you're
  1470. lucky) giving you a chance to save your graphics screen.
  1471.  
  1472. If this happens to you, I would appreciate it if you would write and tell me
  1473. what happened, what error message and error address were reported, and what
  1474. you were doing at the time.  It would also be helpful if you would describe
  1475. your system (CPU, video card and mode, mouse driver, etc).
  1476.  
  1477. Here are a couple of the more common errors and what might be causing them:
  1478.  
  1479. Heap OverFlow Error
  1480. ───────────────────
  1481. This is most likely to happen if you choose a high resolution video mode and
  1482. you don't have enough memory free (or if Iterate! automatically chooses such
  1483. a video mode for you).  It can also happen if you try to load a graphics file
  1484. from disk, and the graphics file was made in a higher resolution video mode
  1485. than you are currently using.
  1486.  
  1487. This error happens because when you switch to a text screen, Iterate! saves the
  1488. current graphics screen to conventional memory (on TurboPascal's "heap").  If
  1489. there isn't enough conventional memory free to save the graphics screen, you get
  1490. a heap overflow error.
  1491.  
  1492. Solutions:
  1493.  
  1494.    * Choose a lower resolution video mode. (See "GRAPHICS MODES" for more
  1495.      details.)
  1496.  
  1497.    * Remove Unnecessary TSR's.
  1498.  
  1499.    * Change your config.sys and autoexec.bat files so that less TSR's are
  1500.      loaded at startup.
  1501.  
  1502.    * Use Himem to load DOS high.
  1503.  
  1504.    * Use EMM386 or a similar memory manager to load your TSR's high.
  1505.  
  1506.  
  1507. "Floating Point Overflow Error" and "Division by Zero Error"
  1508. ────────────────────────────────────────────────────────────
  1509. These errors and other similar errors ("Underflow" or "Overflow" Errors or any
  1510. kind of "Floating Point" error) are most likely caused by the User Function.
  1511. Iterate! tries to prevent these kinds of errors, but it is probably possible
  1512. to cause them if you try hard enough.
  1513.  
  1514. If this happens, I would appreciate it if you would write me with the function
  1515. and the values that caused the problem.
  1516.  
  1517. Other possible causes are the built in functions, or a corrupted .exe file.
  1518.  
  1519. Solutions:
  1520.  
  1521.    If you think the User Function caused the problem:
  1522.  
  1523.    * Change the User Function
  1524.  
  1525.    * Don't enter very large or very small values (greater than 1e16 or less
  1526.      than 1e-16)
  1527.  
  1528.    Otherwise:
  1529.  
  1530.    * Write me for an uncorrupted Iterate!.exe file
  1531.  
  1532.  
  1533. MISCELLANEOUS PROGRAM INFO
  1534. ═══════════════════════════════════════════════════════════════════════════════
  1535. Iterate! is written in TurboPascal 7.0.
  1536.  
  1537. Believe it or not, I have been working on Iterate! off and on for about two
  1538. years now.  It began life on my XT compatible, in TurboPascal 3.0.
  1539.  
  1540. Iterate! has a cousin, Itermold, which translates these iterated points into
  1541. music.  Unfortunately, Itermold is nowhere near public release, and probably
  1542. never will be.  It sounds really nice on my synthesizer, though.
  1543.  
  1544. If you have any questions, comments, or suggestions about Iterate!, you can
  1545. contact me at
  1546.  
  1547.                   986 Raymond Road
  1548.                   Fruit Heights, UT 84037
  1549.                   USA
  1550.                   
  1551.                   voice phone: (816) 356-1740 or (801) 544-5032
  1552.                   Internet   : bhugh@vax1.umkc.edu
  1553.                   FidoNet    : Brent Hugh 1:280/305
  1554.                   
  1555.  
  1556. I might be able to add any particular features you would like (additional
  1557. functions for the User Function, etc.)
  1558.  
  1559. I would particularly like to hear about any bugs you find.
  1560.  
  1561.  
  1562. UPCOMING ADDITIONS
  1563. ═══════════════════════════════════════════════════════════════════════════════
  1564. I am planning to add some features to the next version of Iterate!  Send your
  1565. registration fee in, and I'll get them done faster!
  1566.  
  1567. Also, registered users will receive a copy of the latest version . . . and 
  1568. by the time you're reading this, maybe the latest version with these spiffy
  1569. new features is all finished.
  1570.  
  1571. Coming attractions . . .
  1572.  
  1573.    * Save graphics files in a better format such as GIF or PCX
  1574.    * Provide built in printer support
  1575.    * Iterate in 3-D
  1576.    * Add more Mandelbrot-Julia Set type functions that can be investigated
  1577.      by using Iterate! and the Mandelbrot-Julia generator together
  1578.    * Improve User Function to use If-then statements
  1579.    * Add support for complex numbers to the User Function
  1580.    * Improve help system
  1581.    * Specify default number of iterations in User Function Files
  1582.    * Use colors to show how many times a point has been hit
  1583.    * Make it smaller and faster
  1584.    * Anything you would like and let me know about
  1585.  
  1586.  
  1587. BIBLIOGRAPHY
  1588. ═══════════════════════════════════════════════════════════════════════════════
  1589. Most of these books should be available at your local bookstore.  Others can be
  1590. ordered from Math Products Plus, PO Box 64, San Carlos, CA 94070, (415) 593-
  1591. 2839.
  1592.  
  1593. Computers and the Imagination, by Clifford A. Pickover.  St. Martin's Press, New
  1594. York, 1991.  Poses fascinating problems; a lot of interesting references.
  1595.  
  1596. Computers, Patterns, Chaos, And Beauty, by Clifford A. Pickover.  St. Martin's
  1597. Press, New York, 1990.
  1598.  
  1599. The Fractal Geometry of Nature, by Benoit Mandelbrot.  Freeman, San Francisco,
  1600. 1983.  The seminal book on fractals; relatively non-technical.
  1601.  
  1602. The Beauty of Fractals, by H. Peitgen and P. Richter.  Springer, Berlin, 1986.
  1603. Fabulous color pictures of fractals make up the bulk of this book.
  1604.  
  1605. The Science of Fractal Images, by H. Peitgen and D. Saupe.  Springer, Berlin,
  1606. 1988.
  1607.  
  1608. Chaos, by James Gleick.  A popularization of chaos theory and its many real
  1609. world applications.  Available in many bookstores.
  1610.  
  1611. An Introduction to Chaotic Dynamical Systems, by R.L. Devaney, Benjamin-
  1612. Cummings, Menlo Park, California, 1986.  A very good introduction to the more
  1613. technical side of Iteration Theory.  It is comprehensible by anyone who has
  1614. had a couple of semesters of calculus.
  1615.  
  1616. Turbulent Mirror--An Illustrated Guide to Chaos Theory & the Science of
  1617. Wholeness, by J. Briggs and E. D. Peat.  Another popularization with plenty of
  1618. pictures.
  1619.  
  1620. Fractals, by Jens Feder. Plenum, 1988.
  1621.  
  1622. Fractals Everywhere, by Michael Barnsley. Academic Press, 1988.
  1623.  
  1624. Various articles in Scientific American on fractals and chaos.  The math and
  1625. computer columns in Scientific American regularly have interesting articles.
  1626.  
  1627. (Ver. 3.11, 9/93)
  1628.  
  1629.